package com.engine4cloud.tdf.supervision.feign;

import com.engine4cloud.tdf.common.core.constant.SecurityConstants;
import com.engine4cloud.tdf.common.core.constant.ServiceNameConstants;
import com.engine4cloud.tdf.common.core.util.R;
import com.engine4cloud.tdf.supervision.dto.create.TerminalRegistrationCreateDTO;
import com.engine4cloud.tdf.supervision.dto.result.TerminalRegistrationResultDTO;
import com.engine4cloud.tdf.supervision.dto.update.TerminalRegistrationUpdateDTO;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * 矫正对象-报道登记
 *
 * @author sh
 * @date 2024-08-02 15:07:07
 */
@FeignClient(contextId = "RemoteJzdxRegistrationService", value = ServiceNameConstants.SUPERVISION_SERVER)
public interface RemoteJzdxRegistrationService {

    /**
     * 通过身份证号查询注册人员详情
     *
     * @param identity 身份证号
     * @return R
     */
    @GetMapping("/inner/corrector/{identity}")
    R<TerminalRegistrationResultDTO> getByIdentity(@PathVariable("identity") String identity,
                                                   @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 矫正对象报到登记-注册
     *
     * @param dto 矫正对象报到登记-注册
     * @return R
     */
    @PostMapping("/inner/corrector")
    R<String> register(@Valid @RequestBody TerminalRegistrationCreateDTO dto,
                       @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 矫正对象报到登记-注册
     *
     * @param dto 矫正对象报到登记-注册
     * @return R
     */
    @PutMapping("/inner/corrector")
    R<Boolean> update(@Valid @RequestBody TerminalRegistrationUpdateDTO dto,
                      @RequestHeader(SecurityConstants.FROM) String from);
}
